-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: migrate ref methods to command #3953
refactor: migrate ref methods to command #3953
Conversation
@@ -2,10 +2,10 @@ | |||
* Define Available view type for android | |||
* these values shall match android spec, see ViewType.kt | |||
*/ | |||
enum ResizeMode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
81ff08d
to
57cf079
Compare
android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerViewManager.java
Outdated
Show resolved
Hide resolved
I will check if Interop Layer will work with those changes and I am fine to merge this (after @freeboub review) |
@YangJonghun It also seems that we need to do some renaming as |
I am also wandering if we should use All those changes that I am required from you are from my process of trying to build on New Arch - And I think that we cannot break support for Interop Layer as developers can depend on it. So for now it would be better to back to |
@KrzysztofMoch |
I agree, but I'm a little confused, Am I correct in asking for your suggestion like code below? const setVolume = useCallback((volume: number) => {
- return nativeRef.current && Commands.setVolume(nativeRef.current, volume);
+ return nativeRef.current && Commands.setVolumeCMD(nativeRef.current, volume);
}, []); |
👀 In our example ? I have tried to run app with react-native-video (built from this PR) but I wasn't able to do it in
Yes this is what I meant |
No, I tested on my own bare react-native project (created via |
Strange I also tried to run it on new bare react-native project - it built but there was an error that |
@KrzysztofMoch |
@KrzysztofMoch |
This is something that also thought. I think it would be better to create new arch branch - then step by step migrate it |
@@ -67,6 +67,6 @@ class VideoDecoderPropertiesModule(reactContext: ReactApplicationContext?) : Rea | |||
companion object { | |||
private val WIDEVINE_UUID = UUID(-0x121074568629b532L, -0x5c37d8232ae2de13L) | |||
private const val SECURITY_LEVEL_PROPERTY = "securityLevel" | |||
private const val REACT_CLASS = "VideoDecoderProperties" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it really necessary to change the module name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not required, but I changed it to reduce the chance of duplicates with other library(or core).
|
||
RCT_EXPORT_MODULE(RNVDecoderPropertiesModule); | ||
|
||
RCT_EXPORT_METHOD(getWidevineLevel : (RCTPromiseResolveBlock)resolve reject : (RCTPromiseRejectBlock)reject) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should al least resolve or reject the Promise... (maybe reject with an error "not implemented") , for these 3 methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are meaningless but, acceptable.
I think we should throw an error to notify library contributors.
(we should wrapping decoder properties module on JS side)
@@ -615,15 +611,14 @@ const Video = forwardRef<VideoRef, ReactVideoProps>( | |||
drm={_drm} | |||
style={StyleSheet.absoluteFill} | |||
resizeMode={resizeMode} | |||
fullscreen={isFullscreen} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is big, can you confirm the fullscreen property is still available for apps ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously, we use internal fullscreen state(for handle present,dismiss fullscreen command) but it was meaningless.
fullscreen prop will be inject with {...rest}
and fullscreen commands are work with command.setFullscreen(value).
previous
Rather, the old code was causing different behavior than expected. when user changing fullscreen prop value.
Yes It can make sense, but I am really afraid of divergencies... I don't think this PR is too much risky ... but it is still better to merge steps by steps... |
@freeboub @KrzysztofMoch |
Summary
getReactTag
functionpresentFullscreenPlayer
,dismissFullscreenPlayer
)() => void
() => string | Promise<string>
Motivation
findNodeHandle
(link)save
andgetCurrentPosition
functions return a value. so we have to consider about whether to keep it or drop it.Changes
Test plan